﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using TimKen.App;
using TimKen.BussLogic;

namespace TimKen.Web
{
    public partial class BusinessInfo : WebPage
    {
        public DataEntity.PBrand brand;
        public int brandID;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                if (Request.QueryString["BrandID"] != null && TypeParse.IsNumeric(Request.QueryString["BrandID"]))
                {
                    brandID = Convert.ToInt32(Request.QueryString["BrandID"]);
                }
                else
                {
                    Response.Redirect("/Error.aspx");
                }
                BindData();
            }

        }

        private void BindData()
        {
            PBrandManager am = new PBrandManager();
            brand = am.GetModel(brandID);
            if (brand == null)
                Response.Redirect("/Error.aspx", true);
        }
    }
}